﻿namespace BPM.Web.Shared.Dependencies;

/// <summary>
/// 作用域服务注册依赖
/// 
/// 使用参数根据服务类型注册类
/// 
/// 例如：
/// 
/// <code>
///     [Scoped(typeof(IMyService))]  
///     public class MyService : IMyService  
///     { }
/// </code>
/// </summary>
[AttributeUsage(AttributeTargets.Class)]
public class ScopedAttribute : PrivateDependencyAttribute
{
    /// <param name="serviceType">注册类所依据的服务类型；通常是一个接口</param>
    public ScopedAttribute(Type serviceType)
    {
        ServiceType = serviceType;
    }

    public ScopedAttribute()
    {
    }

    public Type? ServiceType { get; }
}

